"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;

var _vue = require("vue");

var _TableContext = require("../context/TableContext");

var indexGuid = 0;
var Summary = (0, _vue.defineComponent)({
  name: 'Summary',
  props: ['fixed'],
  setup: function setup(props, _ref) {
    var slots = _ref.slots;
    var tableContext = (0, _TableContext.useInjectTable)();
    var uniKey = "table-summary-uni-key-".concat(++indexGuid);
    var fixed = (0, _vue.computed)(function () {
      return props.fixed === '' || props.fixed;
    });
    (0, _vue.watchEffect)(function () {
      tableContext.summaryCollect(uniKey, fixed.value);
    });
    (0, _vue.onBeforeUnmount)(function () {
      tableContext.summaryCollect(uniKey, false);
    });
    return function () {
      var _a;

      return (_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots);
    };
  }
});
var _default = Summary;
exports.default = _default;